<?php

/*

   Aiesec's Alumni System - to manage data about Aiesec's Alumni and
   optimize the knowledge exchange between old and new members.
   Copyright (C) 2009 Vinicius Stein Dani

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/

/*
  
   Author: Vinicius Stein Dani
   Contact: viniciussdani@gmail.com
   Today is: May 25, 2009
   Location at this present moment: Santa Maria - RS - Brasil
  
*/

?>

<?php

  // PEGO DADOS DO CONTROLE ADMINISTRATIVO
  $pega_dados_controle_administracao = mysql_query("SELECT * FROM administracao");
  $mostra_dados_controle_administracao = mysql_fetch_array($pega_dados_controle_administracao);
  
  $id_administracao = $mostra_dados_controle_administracao['id_administracao'];
  $libera_oh = $mostra_dados_controle_administracao['libera_oh'];
  
?>

<?php

  // REALIZO CONTROLE DO MENU DO ADMIN
  if($_POST['submit'] != "" && $_POST['libera_oh'] == "Liberar")
  {
    mysql_query("UPDATE administracao SET libera_oh = 'S' WHERE id_administracao = '$id_administracao'");
  }
  else if($_POST['submit'] != "" && $_POST['libera_oh'] == "Encerrar")
  {
    mysql_query("UPDATE administracao SET libera_oh = 'N' WHERE id_administracao = '$id_administracao'");  
  }
  
?>